﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<easyccms.BusinessLayer.Entities.Article>>" %>
<div class="page-title ui-widget-content ui-corner-all">
    <div class="float-right">
    </div>
    <h1>
        <b>Article Management</b></h1>
    <div class="other">
        <div class="hastable">
            <table id="Table1">
                <thead>
                    <tr>
                        <th>
                            #
                        </th>
                        <th>
                            Title of Article
                        </th>
                        <th>
                            Created
                        </th>
                        <th>
                            Menu Item
                        </th>
                        <th>
                            Menu
                        </th>
                        <td>
                            Author
                        </td>
                        <th>
                            ID
                        </th>
                        <th style="width: 100px">
                            Options
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <%
                        int i = 0;
                        foreach (var item in Model)
                        {%>
                    <tr>
                        <td>
                            <%:i++%>
                        </td>
                        <td>
                            <%:item.Title%>
                        </td>
                        <td>
                            <%:String.Format("{0:g}", item.Created)%>
                        </td>
                        <td>
                            <%:item.MenuItem.Name%>
                        </td>
                        <td>
                            <%:item.MenuItem.Menu.Name%>
                        </td>
                        <td>
                            <%=string.Format("{0} {1}", item.User.UserProfile.Name, item.User.UserProfile.Surname)%>
                        </td>
                        <td>
                            <%:item.ArticleId%>
                        </td>
                        <td>
                            <%=Html.ActionLink("Restore", "BinRestore", new {id = item.ArticleId, action="Article"})%>
                            |
                            <%=Html.ActionLink("Delete", "BinDelete", new { id = item.ArticleId, action = "Article" })%>
                        </td>
                    </tr>
                    <% } %>
                </tbody>
            </table>
        </div>
        <div class="clearfix">
        </div>
    </div>
</div>
